/**
 * Bestpay.com.cn Inc.
 * Copyright (c) 2011-2020 All Rights Reserved.
 */
package com.suxiaoxiao.springbootlearn.designpattern.statepattern.goodcode.stateimpl;

import com.suxiaoxiao.springbootlearn.designpattern.statepattern.goodcode.State;
import com.suxiaoxiao.springbootlearn.designpattern.statepattern.goodcode.pojo.GumballMachine;

/**
 * 未投币状态
 *
 * @author zhaorongzhang
 * @version NoQuarterState.java, v 0.1 2020/1/9 9:32 下午 zhaorongzhang Exp $$
 */
public class NoQuarterState extends State {

    transient GumballMachine gumballMachine;

    public NoQuarterState(GumballMachine gumballMachine) {
        this.gumballMachine = gumballMachine;
    }

    @Override
    public void insertQuarter() {
        System.out.println("已投币");
        gumballMachine.setState(gumballMachine.getHasQuarterState());
    }

}